function QQLoveTipShow(strUrl, strName)
{
	try
	{
		var e = arguments[2] || window.event;
		if (!e)
		{
			return false;
		}
		if (!document.getElementById("QQLoveTipDiv"))
		{
			QQLoveTipCreate();
		}

		if(strUrl && document.getElementById("QQLoveTipImg").src!=strUrl)
		{
			document.getElementById("QQLoveTipImg").style.display = "inline";
			document.getElementById("QQLoveTipInfo").style.display = "none";
			document.getElementById("QQLoveTipImg").src = strUrl;
			
		}else if(strName){
			document.getElementById("QQLoveTipImg").style.display = "none";
			document.getElementById("QQLoveTipInfo").style.display = "inline";
			document.getElementById("QQLoveTipInfo").innerHTML = strName;
		}
		var wTipDiv = document.getElementById("QQLoveTipDiv").scrollWidth;
		var hTipDiv = document.getElementById("QQLoveTipDiv").scrollHeight;

		var wBody = document.body.clientWidth;
		var hBody = document.body.clientHeight;

		var xPos = typeof(e.clientX)!="undefined" ? e.clientX : (e.pageX-document.documentElement.scrollLeft);
		var yPos = typeof(e.clientY)!="undefined" ? e.clientY : (e.pageY-document.documentElement.scrollTop);

		xPos = (xPos+wTipDiv<=wBody) ? (xPos+document.documentElement.scrollLeft+10) : (xPos+document.documentElement.scrollLeft-10-wTipDiv);
		yPos = (yPos+hTipDiv<=hBody) ? (yPos+document.documentElement.scrollTop+10) : (yPos+document.documentElement.scrollTop-10-hTipDiv);

		document.getElementById("QQLoveTipDiv").style.left = xPos+"px";
		document.getElementById("QQLoveTipDiv").style.top = yPos+"px";
		document.getElementById("QQLoveTipDiv").style.visibility = "visible";
		document.getElementById("QQLoveTipDiv").style.backgroundColor = "#FFF";
		document.getElementById("QQLoveTipDiv").style.border = "1px solid #CCC";
		document.getElementById("QQLoveTipDiv").style.padding = "4px";
	}
	catch(e)
	{
		return false;
	}
	return true;
}

function QQLoveTipCreate()
{
	if (!document.getElementById("QQLoveTipDiv"))
	{
		var e = document.createElement("DIV");
		e.id = "QQLoveTipDiv";
		e.style.position = "absolute";
		e.style.visibility = "hidden";
		e.style.zIndex = 1001;
		e.innerHTML	= "<img id='QQLoveTipImg'  />";
		e.innerHTML	+= "<span id='QQLoveTipInfo'></span>";
		document.body.appendChild(e);
	}
}

function QQLoveTipHide()
{
	try
	{
		if (!document.getElementById("QQLoveTipDiv"))
		{
			QQShowTipCreate();
		}
		document.getElementById("QQLoveTipDiv").style.visibility = "hidden";
		document.getElementById("QQLoveTipImg").removeAttribute("src");
	}
	catch(e)
	{
		return false;
	}
	return true;
}
function QQLoveScripShow(id,src)
{
	try
	{
		var e = arguments[2] || window.event;
		if (!e)
		{
			return false;
		}
		var scrip = document.getElementById(id);
		var wTipDiv = scrip.scrollWidth;
		var hTipDiv = scrip.scrollHeight;
	
		var wBody = document.body.clientWidth;
		var hBody = document.body.clientHeight;
	
		var xPos = typeof(e.clientX)!="undefined" ? e.clientX : (e.pageX-document.documentElement.scrollLeft);
		var yPos = typeof(e.clientY)!="undefined" ? e.clientY : (e.pageY-document.documentElement.scrollTop);
	
		xPos = (xPos+wTipDiv+30<=wBody) ? (xPos+document.documentElement.scrollLeft) : (xPos+document.documentElement.scrollLeft-30-wTipDiv);
		yPos = (yPos+hTipDiv<=hBody) ? (yPos+document.documentElement.scrollTop+10) : (yPos+document.documentElement.scrollTop-10-hTipDiv);
	
		scrip.style.left = xPos+"px";
		scrip.style.top = yPos+"px";
		document.getElementById("IconImg").src = src;
		scrip.style.visibility = "visible";
	}
	catch(e)
	{
		alert(e);
		return false;
	}
	return true;
}

function QQLoveScripHide(id)
{
	try
	{
		if (document.getElementById(id))
		{
			document.getElementById(id).style.visibility = "hidden";
		}
	}
	catch(e)
	{
		return false;
	}
	return true;
}

function QQLoveReSendShow(id,scripId,recvName)
{
	try
	{
		var e = arguments[3] || window.event;
		if (!e)
		{
			return false;
		}
		var divObj = document.getElementById(id);
		document.getElementById("recvName").innerHTML = recvName;
		document.getElementById("scrip").value = scripId;
		QQLoveSetDivPos(divObj,e);
		divObj.style.visibility = "visible";
	}
	catch(e)
	{
		return false;
	}
	return true;
}

function QQLoveSetDivPos(divObj,e,offsetLeft,offsetTop){
	var wTipDiv = divObj.scrollWidth;
	var hTipDiv = divObj.scrollHeight;
	
	var wBody = document.body.clientWidth;
	var hBody = document.body.clientHeight;
	
	var xPos = typeof(e.clientX)!="undefined" ? e.clientX : (e.pageX-document.documentElement.scrollLeft);
	var yPos = typeof(e.clientY)!="undefined" ? e.clientY : (e.pageY-document.documentElement.scrollTop);
	
	xPos = (xPos+wTipDiv+30<=wBody) ? (xPos+document.documentElement.scrollLeft) : (xPos+document.documentElement.scrollLeft-30-wTipDiv);
	yPos = (yPos+hTipDiv<=hBody) ? (yPos+document.documentElement.scrollTop+10) : (yPos+document.documentElement.scrollTop-10-hTipDiv);
	
	divObj.style.left = xPos+"px";
	divObj.style.top = yPos+"px";
}

